<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<%@ include file="/wxflow/jsp2/inc/i1510.jsp"%>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="renderer" content="webkit">

    <title><% out.print(WebProperties.WEBTITLE) ;%></title>

    <link href="${pageContext.request.contextPath}/wxflow/res2/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/wxflow/res2/font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet">

    <link href="${pageContext.request.contextPath}/wxflow/res2/css/animate.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/wxflow/res2/css/style.css?v=2.2.0" rel="stylesheet">

</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">Wx+</h1>

            </div>
            <h3>欢迎使用 <% out.print(WebProperties.WEBTITLE) ;%></h3>

            <form class="m-t" role="form" >
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="用户名" required="" id="userName" name="userName">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" placeholder="密码" required="" id="userPw" name="userPw">
                </div>
            </form>
                <button id="btn_login" class="btn btn-primary block full-width">登 录</button>


           
        </div>
    </div>

    <!-- Mainly scripts -->
    <script src="${pageContext.request.contextPath}/wxflow/res2/js/jquery-2.1.1.min.js"></script>
    <script src="${pageContext.request.contextPath}/wxflow/res2/js/bootstrap.min.js?v=3.4.0"></script>
  <script type="text/javascript">
		function fn_login() {
			var data = new Object();
			data['name'] = $("#userName").val();
			data['pwd'] = $("#userPw").val();
			$.ajax({
						url : "${pageContext.request.contextPath}/admin/login.do", 
						async : true,
						dataType : 'json',
						type : 'POST',
						data : data,
						success : function(data, textStatus) {
							if (data.result == "success") {
								window.location.href = "${pageContext.request.contextPath}/wxflow/jsp2/index.jsp";
							} else {
								alert("账户验证错误，请重试!");
							}
						},
						error : function(jqXHR, textStatus, errorThrown) {
						}

					});
			//window.location.href = "index.html";

		}
		$(document).ready(function() {
			$("#btn_login").bind("click", fn_login);

		});
	</script>


</body>

</html>